# -*- coding: utf-8 -*-

from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client

secret_id = 'AKIDRVKwI1gnPmKegS8YDcnmVMwe7rMbtZkh'  # 替换为用户的 secretId
secret_key = 'reCUvOdfRwb2tTLzPdgspWwHOFp8YjdG'  # 替换为用户的 secretKey
region = 'ap-nanjing'  # 替换为用户的 Region

config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)

client = CosS3Client(config)

# 删除单个
# client.delete_object(
#         Bucket='python-1302759476',
#         Key='3a58d23c34839099e1d1fadf8c1c9e5c.jpg',
#     )

# 批量删除
objects = {
    "Quiet": "true",
    "Object": [
        {
            "Key": "cow.jpg"
        },
        {
            "Key": "test.jpg"
        }
    ]
}
client.delete_objects(
    Bucket='ydc-1302759476',
    Delete=objects,
)
